/***********************************************************************//**
     \file Filter.h		\author belot nicolas (karrakis)           
     \brief define Class Filter                                             
     an interface for managing filters                                     
 ************************************************************************//*
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/


#ifndef FILTER_H
#define FILTER_H 1
#include "libtrckr.h"
#include <string>

#include "DynArray"
#include "Sample.h"
#include "Transfert.h"
#include "Buffer.h"

using namespace std;
namespace libtrckr {
class Filter {
	/** \class libtrckr::Filter
	\brief an interface for managing filter
	*/
	public:
		//Constructor
		/*Filter();
		Filter(string);
		Filter(Filter&);*/
		virtual ~Filter();
		//executor
		/** pure virtual function
			Preview should apply filter on data
		\param data the data
		\param size  size of the data
		*/
		virtual double* Preview(double*,int)=0;//preview == execution  ?
		/** pure virtual function
			Preview should apply filter on data
		\param b Buffer containing data
		*/
		virtual Buffer& Preview(Buffer&)=0;//preview == execution  ?
		/** pure virtual function
			Initialise the filter
		*/
		virtual	void Init( )=0;
		/** pure virtual function
			Tune the filter
		*/
		virtual	void Tune(DynArray<int>) = 0;
		/** pure virtuak function
			Same as preview
		*/
		virtual	double* Execution(double *,int)=0;
		/** pure virtuak function
			Same as preview
		*/
		virtual	Buffer& Execution(Buffer&)=0;

		/** is the function is valid for using Transfert arythmetic
		*/
		bool isValidTransfert();
		/** is the function is valid for using DFT arythmetic
		*/
		bool isValidDFT();
		/** Apply the filter
		\param b Buffer containing data
		\return Buffer containing data after the filter apply
		*/
		Buffer& operator << (Buffer&);
		/** Apply the filter
		\param s Sample containing data
		\return Buffer containing data after the filter apply
		*/
		Buffer operator << (Sample&);
		
		/** Apply the filter
		\param b Buffer containing data
		\return Buffer containing data after the filter apply
		*/
		Buffer& operator>>(Buffer&);

		/** Configuration Information
		\return a string containing how to configure the filter
		*/
		virtual string HowToTune()=0;
};
	/** Apply the filter
		\param b Buffer containing data
		\param f Filter
		\return Buffer containing data after the filter apply
		*/
	Buffer& operator<<(Filter&,Buffer&);
	/** Apply the filter
		\param b Buffer containing data
		\param f Filter
		\return Buffer containing data after the filter apply
		*/
	Buffer& operator<<(Buffer&,Filter&);

}	

#endif

